#coding=utf-8

from feedtype import *

from websth.feedspider.config import FEED_TYPE_LIST

class FeedFactory:
    
    @staticmethod
    def createInstance(feedtype):
        if feedtype not in FEED_TYPE_LIST:
            raise Exception("There is no FeedType named %s" % feedtype)
        
        exec("obj = %s()" % feedtype)
        return obj
    